import { Define, EntityObjectFactory } from 'tiny-entity2';
import { PlaceUseLog } from './placeUseLog';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');
@Define.Table({ TableName: "place" })
export class Place extends EntityObjectType<Place>{
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    name: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    note: string;

    @Define.Column({
        DataType: Define.DataType.INT,
    })
    count: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    orgId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    placeTypeId: string;

    @Define.Mapping({
        Mapping: 'PlaceUseLog',
        MappingKey: { FKey: 'placeId', MKey:'id' }
    })
    placeUseLogs: PlaceUseLog[] = [];
}